package com.shxzz.easy12306.services.pay.dto.ali;

import com.shxzz.easy12306.services.pay.common.enums.PayChannelEnum;
import com.shxzz.easy12306.services.pay.common.enums.PayTradeTypeEnum;
import com.shxzz.easy12306.services.pay.common.enums.TradeStatusEnum;
import com.shxzz.easy12306.services.pay.dto.base.AbstractRefundRequest;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 支付宝退款请求实体
 * @author shxzz
 * @create 2024-03-17-22:15
 */
@Data
public class AliRefundRequest extends AbstractRefundRequest {

    /**
     * 退款金额
     */
    private BigDecimal refundAmount;

    /**
     * 交易凭证号
     */
    private String tradeNo;

    @Override
    public String buildMark() {
        String mark = PayChannelEnum.ALI_PAY.name();
        if (getTradeType() != null) {
            mark = PayChannelEnum.ALI_PAY.name() + "_" + PayTradeTypeEnum.findNameByCode(getTradeType()) + "_" + TradeStatusEnum.TRADE_CLOSED.getTradeCode();
        }
        return mark;
    }
}
